#include "const.h"

void seteachext(var_t v, const char *ext) {
	size_t i;
	char tmp[512];

	if (~v->flags & VAR_ARRAY_BIT) {
		s_setext(tmp, sizeof(tmp), v_get(v), ext);
		v_set(v, tmp);
		return;
	}

	for(i=0; i<v->array.n; i++) {
		s_setext(tmp, sizeof(tmp), v_get_array(v, i), ext);
		v_set_array(v, i, tmp);
	}
}
